package org.credo.io;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class KeyinTest {

	public static void main(String[] args) throws IOException {
		System.out.println("begin!");
		//将System.in对象转换成Reader对象
		InputStreamReader reader=new InputStreamReader(System.in);
		//将普通的Reader包装成BufferedReader
		BufferedReader br=new BufferedReader(reader);
		String buffer=null;
		//采取循环方式来逐行的读取
		while ((buffer=br.readLine())!=null) {
			//如果读取的字符串为"exit",就退出程序
			if(buffer.equals("exit")){
				System.exit(1);
			}
			//打印读取的内容
			System.out.println("输入内容为:"+buffer);
		}
	}

}
